/**
 * @file:          Fhan.h
 * @brief:         
 * @details:       
 * @author:        wjh
 * @date created:  2023.10.16
 * @version:       1.0.0
 * @par copyright (c):
 *   
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.10.16,18:39:26
 */


#ifndef _FHAN_H_
#define _FHAN_H_

/* Include Files **************************************************************/
#include "Datatype.h"
#include "common.h"
#include "base_math.h"

/* Macro Definition ***********************************************************/

/* Data Type Define ***********************************************************/
typedef struct Fhan
{
    /* public data */
    uint16_t param_en;
    float param_h;
    float param_f0;

    float in_x1;
    float in_x2;
    float out_u;
    
    float r;
    float w0;
    float d;
    float d0;
    float a0;
    float y;
    float a1;
    float a2;
    float a;
    float d_squre;
    float _8_r;
    float neg_r_div_d;
    float d_div_2;
    
    
    /* private data */
    
    /* public method */
    void (*Init)(struct Fhan *self);
    float (*Run)(struct Fhan *self);
    void (*UpdateParam)(struct Fhan *self);
    
    /* private method */
    
}Fhan;
    
/* Variable Declare ***********************************************************/

/* Function Declare ***********************************************************/
void Fhan_Init(struct Fhan *self);
float Fhan_Run_Normal(struct Fhan *self);
float Fhan_Run_Fsg(struct Fhan *self);
void Fhan_UpdateParam_Normal(struct Fhan *self);
void Fhan_UpdateParam_Fsg(struct Fhan *self);


#endif